<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<!--标准mui.css-->
		<link rel="stylesheet" href="/static/mobile/css/mui.min.css">
		<!--App自定义的css-->

		<link rel="stylesheet" type="text/css" href="/static/mobile/css/mui.picker.min.css" />
		
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">dtpicker（日期时间选择器）</h1>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded">				
				<h5 class="mui-content-padded">设定年份区间</h5>
				<button id='demo2' data-options='{"type":"date","beginYear":2014,"endYear":2016}' class="btn mui-btn mui-btn-block">选择日期 ...</button>				
				<div id='result' class="ui-alert"></div>
			</div>
		</div>
		<link href="/static/mobile/css/mui.min1.css" rel="stylesheet" />
		<script src="/static/mobile/js/mui.min.js"></script>
		<script src="/static/mobile/js/mui.picker.min.js"></script>
		<script>
		     /**
			(function($) {
				$.init();
				var result = $('#result')[0];
				var btns = $('.btn');
				//btns.each(function(i, btn) {
				var btn=$("#demo2")[0];
					btn.addEventListener('tap', function() {
						var optionsJson = this.getAttribute('data-options') || '{}';
						var options = JSON.parse(optionsJson);
						var id = this.getAttribute('id');
						var picker = new $.DtPicker(options);
						picker.show(function(rs) {
							result.innerText = '选择结果: ' + rs.text;
							picker.dispose();
						});
					}, false);
				//});
			})(mui);
			**/
			
		mui.init();
		(function($) {
			    var result = $('#result')[0];
				var btn=$("#demo2")[0];
					btn.addEventListener('tap', function() {
						var optionsJson = this.getAttribute('data-options') || '{}';
						var options = JSON.parse(optionsJson);
						var id = this.getAttribute('id');
						var picker = new $.DtPicker(options);
						picker.show(function(rs) {
							result.innerText = '选择结果: ' + rs.text;
							picker.dispose();
						});
					}, false);			
			
		})(mui);		
			
		</script>
	</body>

</html>